/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin		 	*/
/*	Project:	GoLib-1.0.0			*/
/*	Author:		gong_libin			*/
/*	Date:		2016_01_01			*/
/*	File:		GoRedisTest.go			*/
/********************************************************/

// go get github.com/garyburd/redigo/redis

package main

import (
	. "GoGlb"
	S "GoSql"
)

func main() {
	r := new(S.GoRedis)
	if e := r.GoRedisOpen("tcp", "127.0.0.1:6379"); nil == e {
		/* insert */
		for i := 1; i < 100; i ++ {
			k := GoValue("%d", i)
			v := GoValue("%d", i * 10)
			r.GoRedisInsert("SET", k, v)
		}
		/* select */
		s := r.GoRedisStrings(r.GoRedisKeys())
		for _, n := range s {
			GoPrint("%s\n", n)
		}
		r.GoRedisClean()
		r.GoRedisClose()
	} else {
		GoPrint("Failed to GoRedisOpen\n")
	}
}
